package appapi.service.impl;

import appapi.Request.RolepermissionReq;
import appapi.dao.RolepermissionMapper;
import appapi.entity.auth.ModulelistEntity;
import appapi.entity.auth.RolepermissionEntity;
import appapi.service.RolepermissionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 角色权限
 *
 * @author lc
 * @version 1.0
 * @date 2023-05-17 10:08:27
 */
@Service
public class RolepermissionServiceImpl extends ServiceImpl<RolepermissionMapper, RolepermissionEntity> implements RolepermissionService {

    @Autowired
    private RolepermissionMapper rolepermissionMapper;

    @Override
    public List<ModulelistEntity> list(RolepermissionReq rolepermissionReq) {
        return rolepermissionMapper.selectMoudleList(rolepermissionReq);
    }

    @Override
    public List<RolepermissionEntity> detail(Long roleId) {
        return rolepermissionMapper.detail(roleId);
    }

    @Override
    public int insert(RolepermissionEntity rolepermissionEntity) {
        return rolepermissionMapper.insert(rolepermissionEntity);
    }

    @Override
    public int insertBatch(List<RolepermissionEntity> authList) {
        return rolepermissionMapper.insertBatch(authList);
    }
    @Override
    public int deleteBatch(Long roleId,List<Long> moduIds) {
        return rolepermissionMapper.deleteBatch(roleId,moduIds);
    }
}
